import type { DatePickerProps } from 'antd';
import { DatePicker, Space } from 'antd';
import type { Dayjs } from 'dayjs';
import { useState } from 'react';

const Home = () => {
  const [date, setdate] = useState<string | string[]>('');
  const onChange: DatePickerProps<Dayjs[]>['onChange'] = (date, dateString) => {
    console.log(date, dateString);
    setdate(dateString);
  };
  return (
    <>
      <div className="home-app">
        <Space direction="vertical" size={12}>
          <span>选中的时间：{date}</span>
          <DatePicker onChange={onChange} showTime needConfirm={false} />
        </Space>
      </div>
    </>
  );
};
export default Home;
